/*
 * @Author: 尔尔
 * @Date: 2024-04-09 16:10:54
 * @LastEditors: 尔尔
 * @LastEditTime: 2024-04-23 11:53:30
 * @FilePath: \ERP\src\views\Home\subassembly\mixin.js
 * @filePurpose:
 */
import { getFirstDayOfYear, getLastDayOfYear } from "@/utils/index"
import { getYear } from "@/utils/index"

export const mixinDateRange = {
	data() {
		return {
			timeRange: ""
		}
	},
	watch: {
		timeRange: {
			handler(newVal, oldVal) {
				this.getData()
			},
			deep: true,
			// immediate: true
		}
	},
	mounted() {
		this.timeRange = [getFirstDayOfYear(), getLastDayOfYear()]
	}
}

export const mixinYear = {
	data() {
		return {
			year: ""
		}
	},
	watch: {
		year: {
			handler(newVal, oldVal) {
				this.getData()
			},
			deep: true,
			// immediate: true
		}
	},
	mounted() {
		this.year = getYear()
	}
}
